package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.SysInvestorBack;
import com.ruoyi.system.mapper.SysInvestorBackMapper;
import com.ruoyi.system.service.ISysInvestorBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 赎回Service业务层处理
 * 
 * @author paul
 * @date 2023-06-25
 */
@Service
public class SysInvestorBackServiceImpl implements ISysInvestorBackService
{
    @Resource
    private SysInvestorBackMapper sysInvestorBackMapper;

    /**
     * 查询赎回
     * 
     * @param id 赎回主键
     * @return 赎回
     */
    @Override
    public SysInvestorBack selectSysInvestorBackById(Long id)
    {
        return sysInvestorBackMapper.selectSysInvestorBackById(id);
    }

    /**
     * 查询赎回列表
     * 
     * @param sysInvestorBack 赎回
     * @return 赎回
     */
    @Override
    public List<SysInvestorBack> selectSysInvestorBackList(SysInvestorBack sysInvestorBack)
    {
        return sysInvestorBackMapper.selectSysInvestorBackList(sysInvestorBack);
    }

    /**
     * 新增赎回
     * 
     * @param sysInvestorBack 赎回
     * @return 结果
     */
    @Override
    public int insertSysInvestorBack(SysInvestorBack sysInvestorBack)
    {
        sysInvestorBack.setCreateTime(DateUtils.getNowDate());
        return sysInvestorBackMapper.insertSysInvestorBack(sysInvestorBack);
    }

    /**
     * 修改赎回
     * 
     * @param sysInvestorBack 赎回
     * @return 结果
     */
    @Override
    public int updateSysInvestorBack(SysInvestorBack sysInvestorBack)
    {
        sysInvestorBack.setUpdateTime(DateUtils.getNowDate());
        return sysInvestorBackMapper.updateSysInvestorBack(sysInvestorBack);
    }

    /**
     * 批量删除赎回
     * 
     * @param ids 需要删除的赎回主键
     * @return 结果
     */
    @Override
    public int deleteSysInvestorBackByIds(Long[] ids)
    {
        return sysInvestorBackMapper.deleteSysInvestorBackByIds(ids);
    }

    /**
     * 删除赎回信息
     * 
     * @param id 赎回主键
     * @return 结果
     */
    @Override
    public int deleteSysInvestorBackById(Long id)
    {
        return sysInvestorBackMapper.deleteSysInvestorBackById(id);
    }
}
